﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;

namespace DAO
{
    public class PhongDAO
    {
        public static int ThemPhong(PhongDTO phong)
        {
            int kq = -1;

            string sql ;
            sql = "Insert into Phong(TenPhong, MaLoaiPhong, GhiChu, TinhTrangPhong) values (";            
            sql += "'" + phong.TenPhong + "', ";
            sql += phong.MaLoaiPhong.ToString() + ", ";
            sql += "'" + phong.GhiChu + "', ";
            sql += phong.TinhTrangPhong.ToString() + ")";
            sqlDataAccessHelper db = new sqlDataAccessHelper();
            kq = db.ExecuteNonQuery(sql);
           
            return kq;
        }
    }
}
